# 继承
# 让类和类之间转变成父子关系，子类继承父类的属性和方法
# 语法
# class 类名(父类):
#     代码块
# class Person:
#     def eat(self):
#         print('eat')
#     def sing(self):
#         print('sing')
#
# class Girl(Person):
#     pass
#
# girl = Girl()
# girl.eat()
# girl.sing()

# 继承的传递（多重继承）
# A/B/C C类继承于B类，B类继承A类，C类具有A/B类的属性和方法
class Father:
    def eat(self):
        print('eat')

class Son(Father):
    pass

class GrandSon(Son):
    pass

grandson = GrandSon()
grandson.eat()

son = Son()
son.eat()